import 'base_res.dart';

class ExchangeRecordModelList {
  int? total;
  List<ExchangeRecordModel>? data;

  ExchangeRecordModelList.fromJson(dynamic json) {
    total = json['total'];
    if (json['data'] != null) {
      data = <ExchangeRecordModel>[];
      json['data'].forEach((v) {
        data!.add(ExchangeRecordModel.fromJson(v));
      });
    }
  }
}

class ExchangeRecordModel extends BaseItem {
  String? id;
  String? code;
  num? userID;
  String? batchNum;
  String? channel;
  String? authority;
  String? desc;
  num? reward;
  String? createdAt;

  ExchangeRecordModel({
    this.id,
    this.code,
    this.userID,
    this.batchNum,
    this.channel,
    this.authority,
    this.desc,
    this.reward,
    this.createdAt,
  });

  ExchangeRecordModel.fromJson(dynamic json) {
    id = json['id'];
    code = json['code'];
    userID = json['userID'];
    batchNum = json['batchNum'];
    channel = json['channel'];
    authority = json['authority'];
    desc = json['desc'];
    reward = json['reward'];
    createdAt = json['createdAt'];
  }

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = id;
    map['code'] = code;
    map['userID'] = userID;
    map['batchNum'] = batchNum;
    map['channel'] = channel;
    map['authority'] = authority;
    map['desc'] = desc;
    map['reward'] = reward;
    map['createdAt'] = createdAt;
    return map;
  }
}
